<{include file="app/header.tpl"}>
<script>
function submit_cash() {

    var maxMoney = $('input[name="money"]').attr('maxMoney');
    var iptMoney = $('input[name="money"]').val();
    var iptUserName = $('input[name="alipayUserName"]').val();
    var iptAccount  = $('input[name="alipayAccount"]').val();

    if (!iptUserName)
    {
        alert('请输入有效姓名');
        return false;
    }

    if (!iptAccount) {
        alert('请输入有效支付宝账户');
        return false;
    }

    if (! iptMoney)
    {
        alert('请输入提现金额');
        return false;
    }

    if (maxMoney == 0)
    {
        alert('可提现金额不足');
        return false;
    }

    if (iptMoney * 100 > maxMoney )
    {
        alert('金额超限' + ', 最多只允许提现: ' + maxMoney / 100 + '元');
        return false;
    }

    if(iptMoney *100 <1000){
        alert('最少提现金额为10元');
        return false;
    }
}

function enter_submit_cash() {
    var event = window.event || arguments.callee.caller.arguments[0];
    if (event.keyCode == 13) {
         submit_cash();
    }
}

</script>

<div class="income-header" style="padding: 0;">
    <ul class="cash fix">
        <li class="li">
            <p class="one">本店收益</p>
            <p class="two">￥<{$account.incomeMoney/100|@number_format:2}></p>
        </li>
        <li class="li">
            <p class="one">可提现</p>
            <p class="two">￥<{$account.money/100|@number_format:2}></p>
        </li>
        <li class="li">
            <p class="one">提现中</p>
            <p class="two">￥<{$moneyCashing/100|@number_format:2}></p>
        </li>
        <li class="li">
            <p class="one">待确定收益</p>
            <p class="two">￥0.00</p>
        </li>
    </ul>
</div>

<ul class="income-title fix">
    <li class="li"><a href="/share/income"><em class="circle"></em><span class="gray">收益</span></a></li>
    <li class="li"><a href="/share/cash"><em class="active"></em><span class="yellow">提现</span></a></li>
    <li class="li"><a href="/share/coin"><em class="circle"></em><span class="gray">金币</span></a></li>
</ul>

<p class="cash-prompt">
    提现说明
</p>
<p class="cash-text"> 温馨提醒：1、提现到账时间为:分销商自申请日起2个工作日 到账，双休日除外。2、请正确填写您的支付宝姓名及收款账 号！ </p>

<p class="cash-prompt">
    提现申请
</p>

<form action="" method="post" class="cash-form" onclick="return enter_submit_cash();">
    <input type="text" required placeholder="姓名" name="alipayUserName" class="alipayUserName" id="">
    <input type="text" required placeholder="支付宝账号" name="alipayAccount" class="alipayAccount" id="">
    <input type="text" required placeholder="提取金额（最少¥10.00）" name="money" class="money" id="" maxMoney="<{$account.money}>">
    <input type="submit" name="submit" class="submit" value="申请提现" onclick="return submit_cash();">
</form>

<p class="cash-prompt">
    提现记录
</p>

<div>
    <{if $records|@count neq 0 }>
        <ul class="money-income-ul">
            <{foreach from=$records item="item"}>
                <li class="li">
                    <p class="line">
                        时间:<{"Y-m-d H:i:s"|@date:$item.created}>
                    </p>
                    <p class="line">
                        金额:<span class="red">￥<{$item.money/100|number_format:2}></span>
                    </p>
                    <p class="line">
                        状态:<{$item.statusName}>
                    </p>
                    <p class="line">
                        备注: <{$item.comments}>
                    </p>
                </li>
            <{/foreach}>
        </ul>
     <{else}>
        <p class="income-money-empty"> 还没有提现数据</p>
    <{/if}>

</div>

<{include file="app/footer.tpl"}>
